<link rel="stylesheet" href="../addons/jy_aligroup/custom/templates/mobile/css/style.css?v-201911" />
<style type="text/css">
	.creditshop-detail-page .fui-navbar .abtn{height:2.6rem;width:40%;font-size:12px;-webkit-border-radius: 0;border-radius: 0;padding:0.5rem 0 0 0;display: block;float:left;
		line-height: 0.8rem;}
	.creditshop-detail-page .fui-navbar .homeabtn{height:2.6rem;width:20%;font-size:12px;-webkit-border-radius: 0;border-radius: 0;margin:0;padding:0;display: block;float:left;background: #fff;
		color:#666;border:none;line-height: 2.6rem;}
	.homeabtn .icon{font-size:1rem;}
	.text-danger span{color:#ef4f4f;font-size:1rem;}
p {
	margin:0
}
.lynn_fightgroups_span strong.fl p,.lynn_fightgroups_span strong.fl b {
    margin: 0 0.2rem;
}
</style>
<div class='fui-page creditshop-detail-page'>
	<div class="fe-floatback right" style="left:0.2rem">
		<a ng-click="goback()">
			<i class="icon jinyunicon icon-back"></i>
		</a>
	</div>
	<div class='fui-content'>
		<!--轮播图-->
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
			<div class="carousel-inner" role="listbox" style="height:auto">
				<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.goods.images">
					<a href="#">
						<img src="{{tomedia(item) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
				<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
						<div class="fui-swipe-bullet" ng-repeat="item in pagedata.goods.images" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
				</div>
		</div>
		<div class="lynn_goods_head">
			<div class="lynn_goods_head_title">
				<span>{{pagedata.group.groupnum}}人成团</span>{{pagedata.goods.title}}
			</div>
			<span class="lynn_goods_follow" style="display: none;">
				<i class="iconfont icon">&#xe606;</i><i class="iconfont icon on">&#xe605;</i>收藏
			</span>
		
			<p ng-if="pagedata.goods.subtitle" class="lynn_goods_head_subtitle">
				{{pagedata.goods.subtitle}}
			</p>
			
			<div class="lynn_goods_head_info">
				¥ <strong>{{pagedata.goods.groupsprice}}</strong>/{{ifelse(pagedata.goods.units,pagedata.goods.goodsnum+pagedata.goods.units,'1件')}} <del>¥ {{pagedata.goods.price}}</del>
				<span class="fr">
					已有<b>{{pagedata.goods.fightnum}}</b>人参团，销量<b>{{pagedata.goods.salenum}}</b>
				</span>
				<div style="clear:both;"></div>
			</div>
			
			<div ng-if="pagedata.group.isdiscount==1" class="lynn_goods_discount">
				【团长优惠 <span ng-if="pagedata.group.headstype==0">¥{{pagedata.group.headsmoney}}</span>
							<span ng-if="pagedata.group.headstype==1">{{pagedata.group.headsdiscount}}折</span>】
			</div>
		
		</div>
		<div class="lynn_goods_invitation">
			*开团并邀请{{pagedata.group.groupnum-1}}人参团，人数不足自动退款，详见<a href="javascript:;" ng-click="access_json('/rules/')">拼团玩法</a>
		</div>
		<div class="lynn_fightgroups">
			<div class="lynn_fightgroups_head">以下小伙伴正在发起拼团，您可以直接参加！</div>
			<ul ng-if="pagedata.list.length>0" class="lynn_fightgroups_list">
				<li ng-repeat="item in pagedata.list">
					<img ng-src="{{item.header.avatar}}" alt="{{item.header.nickname}}">
					<span class="lynn_fightgroups_span row">
						<strong class="fl" ng-init="tool.time_down(pagedata.times[item.id])">
							<p>{{ifelse(item.header.nickname,item.header.nickname,'匿名')}}</p>
							<b>剩余：<i>{{pagedata.times[item.id].hour}}:{{pagedata.times[item.id].minite}}:{{pagedata.times[item.id].second}}</i></b>
						</strong>
						<strong class="fr">
							还差<b>{{item.num}}</b>人成团
						</strong>
					</span>
					<a href="javascript:;" ng-click="access_json('jy_aligroup/confirm/confirm/goodsid='+item.goodsid+'&teamid='+item.id+'&groupid='+item.groupid+'&type=groups')" class="fr">去参团</a>
				</li>
				<dt ng-if="!isnodata" class="lynn_team_list_top" ng-click="pagedata.get_list()">
						<p style="background:none" >加载更多团详情 <i class="iconfont icon lynn_icon">&#xe764;</i></p>
				</dt>
			</ul>
			<div ng-if="!pagedata.list || pagedata.list.length==0" class="lynn_fight_nomarl">
				<i class="icon icon-lianxishangjia"></i> 暂无相关团购
			</div>
		</div>
		<div class="lynn_goods_content">
			<div class="lynn_goods_content_title"><span>图文详情</span></div>
			<div ng-if="pagedata.goods.content" class="lynn_goods_content_info content-images" ng-bind-html="trust(pagedata.goods.content)">
			</div>
			<div ng-if="pagedata.groupsset.groups_description" class="lynn_goods_content_info content-images" ng-bind-html="trust(pagedata.groupsset.groups_description)">
			</div>
			<div ng-if="!pagedata.goods.content" class="lynn_goods_content_info content-images" ng-bind-html="trust(pagedata.goods.description)">
			</div>
		</div>
		<div style="height:2.5rem;"></div>
	</div>
	<div class="fui-navbar bordert" style="z-index:100;padding:0;">
		<a class="homeabtn btn" style="" href="javascript:;" ng-click="access_json('jy_aligroup/index/')">
			<p class="icon jinyunicon icon-shouye"></p>
		</a>
		<a ng-if="pagedata.goods.stock" class="homeabtn btn " style="" href="javascript:;" ng-click="access_json('jy_aligroup/index/')">
			<p class="icon jinyunicon icon-shouye" href="javascript:;" ng-click="access_json('jy_aligroup/index/')">首页</p>
		</a>
		<a ng-if="pagedata.group.single==1 && pagedata.group.endstatus==1" class="lynn_goods_btn lynn_btn_waring btn-single" ng-click="access_json('jy_weishop/order.create//goodsid='+pagedata.goods.id+'&num=1&active_plugin=jy_aligroup&active_id='+pagedata.group.id)">
			<p>¥ <strong>{{pagedata.group.singleprice||pagedata.goods.price}}</strong></p> <p>单独购买</p>
		</a>
		<a ng-if="pagedata.group.single!=1 && pagedata.group.endstatus==1" class="lynn_goods_btn lynn_btn_waring btn-single disabled" style="background:#ccc">
			<p>¥ <strong>{{pagedata.goods.price}}</strong></p> <p>不支持单独购买</p>
		</a>
		<a ng-if="pagedata.group.endstatus==1" class="lynn_goods_btn lynn_btn_danger" data-nocache="true" href="javascript:;" ng-click="access_json('jy_aligroup/openGroups//goodsid='+pagedata.goods.id+'&groupid='+pagedata.group.id)">
			<p>¥ <strong>{{pagedata.goods.groupsprice}}</strong></p> {{pagedata.group.groupnum || '0'}}人成团
		</a>
		<a ng-if="pagedata.group.endstatus!=1" class="lynn_goods_btn lynn_btn_waring disabled" style="background:#ccc;width:80%">
			<p>¥ <strong>{{pagedata.goods.groupsprice || pagedata.goods.price}}</strong></p> <p>{{pagedata.group.statustitle}}</p>
		</a>
	</div>
</div>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
scope.loading = true;  //状态标记
scope.isnodata = false;
//滚动加载
scope.tool.get_list('jy_aligroup/goods/getteams/groupid='+scope.pagedata.group.id,true,function(res){
	scope.pagedata.times=res.times;
});
scope.pagedata.get_list=function(){
	scope.tool.get_list('jy_aligroup/goods/getteams/groupid='+scope.pagedata.group.id,'',function(res){
		if(!Array.isArray(res)){
				var times=res.times?res.times:[]
				if(times.length==0){
					scope.isnodata=true;
					scope.message('没有更多了！');
				}else{
					for(var key in times){
						scope.pagedata.times[key]=times[key];
					}
				}
				scope.$evalAsync();
		}		
	});
}
</script>